package com.yzt.message.util;

import com.yzt.zhuju.message.ConversationInfo;

import io.rong.imkit.conversationlist.model.BaseUiConversation;

/**
 * @author matthewzhao
 *         created on: 2022/7/19 17:47
 *         description: model转换工具
 */
public class ConvertModelUtil {

    /**
     * 转换会话信息
     * @param conversation 融云的会话信息类
     */
    public static ConversationInfo convertConversationInfo(BaseUiConversation conversation) {
        ConversationInfo conversationInfo = new ConversationInfo();
        if (conversation != null) {
            conversationInfo.setSenderUserId(conversation.mCore.getSenderUserId());
            conversationInfo.setAvatar(conversation.mCore.getPortraitUrl());
        }
        return conversationInfo;
    }
}
